﻿using NAudio.Midi;

namespace PT.NoteDetection.Midi {
    class EventHelper {

        public static NoteEvent CreateNoteOnEvent(long time, sbyte velocity) {
            return CreateNoteEvent(time, MidiCommandCode.NoteOn, velocity);
        }

        public static NoteEvent CreateNoteOffEvent(long time) {
            return CreateNoteEvent(time, MidiCommandCode.NoteOff, 0);
        }

        static NoteEvent CreateNoteEvent(long time, MidiCommandCode commandCode, sbyte velocity) {
            return new NoteEvent(time, (int)Channel.PercussionChannel1, commandCode, (int)Instrument.Snare, velocity);
        }
    }
}
